<?php
/**
 * +----------------------------------------------------------------------
 * | 验证器
 * +----------------------------------------------------------------------
 *                                            ...     .............
 *                                          ..   .:!o&*&&&&&ooooo&; .
 *                                        ..  .!*%*o!;.
 *                                      ..  !*%*!.      ...
 *                                     .  ;$$!.   .....
 *                          ........... .*#&   ...
 *                                     :$$: ...
 *                          .;;;;;;;:::#%      ...
 *                        . *@ooooo&&&#@***&&;.   .
 *                        . *@       .@%.::;&%$*!. . .
 *          ................!@;......$@:      :@@$.
 *                          .@!   ..!@&.:::::::*@@*.:..............
 *        . :!!!!!!!!!!ooooo&@$*%%%*#@&*&&&&&&&*@@$&&&oooooooooooo.
 *        . :!!!!!!!!;;!;;:::@#;::.;@*         *@@o
 *                           @$    &@!.....  .*@@&................
 *          ................:@* .  ##.     .o#@%;
 *                        . &@%..:;@$:;!o&*$#*;  ..
 *                        . ;@@#$$$@#**&o!;:   ..
 *                           :;:: !@;        ..
 *                               ;@*........
 *                       ....   !@* ..
 *                 ......    .!%$! ..     | AUTHOR: dfer
 *         ......        .;o*%*!  .       | EMAIL: df_business@qq.com
 *                .:;;o&***o;.   .        | QQ: 3504725309
 *        .;;!o&****&&o;:.    ..          | WEBSITE: http://www.dfer.site
 * +----------------------------------------------------------------------
 *
 */

namespace plugins\dfer_thinkcmf_tools\validate;

use think\Validate;

class SmsValidate extends Validate
{
    protected $regex = [
        'mobile'=> '/1[345789]{1}\d{9}$/i',
    ];
    protected $rule = [      
        'PhoneNumbers'        => 'require|regex:mobile',
        'SignName'        => 'require',
        'TemplateCode'        => 'require',
        'TemplateParam'        => 'require',
    ];

    protected $message = [
        'PhoneNumbers.require' => '缺失手机号',
        'PhoneNumbers.regex'     => '手机号格式不正确',
        'SignName.require'     => '缺失短信签名',
        'TemplateCode.require'     => '缺失模版CODE',
        'TemplateParam.require'     => '缺失模版参数',
    ];
}
